package com.hontech.kaltaapp.ui.parts

import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.Button
import android.widget.FrameLayout
import com.hontech.kaltaapp.R
import com.hontech.kaltaapp.device.scan
import com.hontech.kaltaapp.ui.dialog.runProg
import com.hontech.kaltaapp.ui.dialog.runProgMsg
import com.hontech.kaltaapp.utils.onClick

class ScanParts (context: Context, attrs: AttributeSet) : FrameLayout(context, attrs) {

    init {
        val view = LayoutInflater.from(context).inflate(R.layout.parts_scan, this)
        val btn = view.findViewById<Button>(R.id.id_scan_btn_scan)
        btn.onClick {
            runProgMsg("扫码", "扫码") {
                scan()
            }
        }
    }
}